<template>
  <div>
    <commentReplyListItem v-for="replyData in replyList" :key="replyData.replyId" 
        :replyData='replyData'
        @replyEvent='handlerReplyEvent'>
    </commentReplyListItem>
    <page 
        :pageData='pageData'
        @pageChangeEvent='handlerPageChange'>
    </page>
  </div>
</template>

<script>
import commentReplyListItem from './comment-reply-list-item'
import page from '../common/page/page'
export default {
  components: {
    commentReplyListItem,
    page,
  },
  mounted() {
    
  },
  props:{
      replyList: Array, // 回复 列表
      pageData: Object,
  },
  data() {
    return {
        // 回复 列表
        /*dataList: [
            {
                replyId:1,
                fromId:2,
                toId:1,
                infoId:1,
                commentId:1,
                replyType:1,
                replyContent:"回复评论1",
                createTime:"2021/05/10 19:12:13",
                fromNickName:'老朱',
                fromPortrait:'',
                toNickName:'老张',
            },{
                replyId:2,
                fromId:1,
                toId:2,
                infoId:1,
                commentId:1,
                replyType:0,
                replyContent:'回复回复1',
                createTime:'2021/05/10 19:12:55',
                fromNickName:'老张',
                fromPortrait:'',
                toNickName:'老朱',
            },
            
        ],*/
        pageIndex: 1,
        pageSize: 10,
        totalPage: 0,
    }
  },
  methods: {
    // 评论事件，继续向上，打开评论框。
    handlerReplyEvent(data){
        console.log("comment-reply-list：打开评论框", data);
        this.$emit('replyEvent', data);
    },
    // 页面发生修改时
    handlerPageChange(data){
        console.log("comment-reply-list：页面发生修改", data)
        this.$emit('pageChangeEvent', data);
    }
  },
}
</script>

<style>

</style>